<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="http://www.ecside.org" prefix="ec"%>
<jsp:useBean id="pageBean" scope="request" class="com.agileai.hotweb.domain.PageBean"/>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>在办流程列表</title>
<%@include file="/jsp/inc/resource.inc.jsp"%>
<script language="javascript">
var showProcInstBox;
function viewInstanceRequest(){
	if (!isSelectedRow()){
		writeErrorMsg('请先选中一条记录!');
		return;		
	}
	if (!showProcInstBox){
		showProcInstBox = new PopupBox('showProcInstBox','流程定义图',{width:'900px',height:'500px',top:'10px',scroll:'yes'});		
	}	
	var url = "index?WfProcessInstanceView&actionType=prepareDisplay&WFIP_ID="+$('#WFIP_ID').val() +"&WFP_ID="+$('#WFP_ID').val();
	showProcInstBox.sendRequest(url);
}

var showBusinessInfoBox;
function viewBusinessInfoRequest(){
	if (!isSelectedRow()){
		writeErrorMsg('请先选中一条记录!');
		return;		
	}
	if (!showBusinessInfoBox){
		showBusinessInfoBox = new PopupBox('showBusinessInfoBox','业务表单',{width:'900px',height:'500px',top:'10px',scroll:'yes'});		
	}	
	var url = $('#WFP_DETAIL_URL').val();
	showBusinessInfoBox.sendRequest(url);
}

var selectUserBox;
function selectUserRequest(){
	if (!selectUserBox){
		selectUserBox = new PopupBox('selectUserBox','选择用户',{size:'big',height:'420px',width:'300px',top:'10px'});		
	}
	var url = 'index?SingleUserTreeSelect';
	selectUserBox.sendRequest(url);
}

var processIdBox;
function openProcessIdBox(){
	var handlerId = "ProcessListSelectList"; 
	if (!processIdBox){
		processIdBox = new PopupBox('processIdBox','请选择流程',{size:'normal',width:'300',top:'2px'});
	}
	var url = 'index?'+handlerId+'&targetId=processId&targetName=flowName';
	processIdBox.sendRequest(url);
} 

function emptyText(inputId){
	ele(inputId).value = '';
}
</script>
</head>
<body>
<form action="<%=pageBean.getHandlerURL()%>" name="form1" id="form1" method="post">
<%@include file="/jsp/inc/message.inc.jsp"%>
<div id="__ParamBar__" style="float: right;">
<% 
if (!pageBean.getBoolValue("embed")){
%>
当前用户
<input name="userName" type="text" class="text" id="userName" ondblclick="selectUserRequest()" value="<%=pageBean.inputValue("userName")%>" size="16" maxlength="16" readonly="readonly" />
<input name="userId" type="hidden" id="userId" value="<%=pageBean.inputValue("userId")%>" /><img src="images/query.gif" width="16" height="16" onclick="selectUserRequest()" style="cursor:pointer" />
&nbsp;&nbsp;&nbsp;&nbsp;
<input type="button" name="button" id="button" value="查询" class="formbutton" onclick="doQuery()" />
<%}%>
</div>
<div id="__ToolBar__">
<table border="0" cellpadding="0" cellspacing="1">
<tr height="24px;">
	<td onmouseover="onMover(this);" onmouseout="onMout(this);" hotkey="D" class="bartdx" align="center" onclick="doSubmit({actionType:'prepareDisplay'})"><input value="&nbsp;" type="button" class="refreshImgBtn" title="刷新">刷新</td>
	<td onmouseover="onMover(this);" onmouseout="onMout(this);" hotKey="F" class="bartdx" align="center" onClick="viewBusinessInfoRequest()"><input value="&nbsp;" type="button" class="detailImgBtn" title="查看表单" />查看表单</td>
	<td onmouseover="onMover(this);" onmouseout="onMout(this);" hotKey="G" class="bartdx" align="center" onClick="viewInstanceRequest()"><input value="&nbsp;" type="button" class="flowStateImgBtn" title="查看流程" />查看流程</td>
</tr>
</table>
</div>
<div id="__ParamBar__">
<table class="queryTable"><tr><td>
&nbsp;流程名称 <input id="flowName" label="流程名称 " name="flowName" type="text" value="<%=pageBean.inputDate("flowName")%>" size="24" class="text" ondblclick="emptyText('flowName')" />
<input type="hidden" label="流程名称选择" id="processId" name="processId" value="<%=pageBean.inputValue("processId")%>" />
<img id="processIdSelectImage" src="images/sta.gif" width="16" height="16" onclick="openProcessIdBox()" />
&nbsp;业务标题<input id="title" label="标题" name="title" type="text" value="<%=pageBean.inputValue("title")%>" size="10" class="text"/>
&nbsp;发起日期<input id="sdate" label="开始日期" name="sdate" type="text" value="<%=pageBean.inputDate("sdate")%>" size="10" class="text" readonly="readonly"/><img id="sdatePicker" src="images/calendar.gif" width="16" height="16" alt="日期/时间选择框" />
-<input id="edate" label="截止日期" name="edate" type="text" value="<%=pageBean.inputDate("edate")%>" size="10" class="text"  readonly="readonly"/><img id="edatePicker" src="images/calendar.gif" width="16" height="16" alt="日期/时间选择框" />

&nbsp;<input type="button" name="button" id="button" value="查询" class="formbutton" onclick="doQuery()" />
</td></tr></table>
</div>
<ec:table 
form="form1"
var="row"
items="pageBean.rsList" csvFileName="仿真任务列表.csv"
retrieveRowsCallback="process" xlsFileName="仿真任务列表.xls"
useAjax="true" sortable="true"
doPreload="false" toolbarContent="navigation|pagejump |pagesize |export|extend|status"
width="100%" rowsDisplayed="10"
listWidth="100%" 
height="400px" 
>
<ec:row styleClass="odd" ondblclick="viewInstanceRequest()" oncontextmenu="selectRow(this,{WFIP_ID:'${row.WFIP_ID}'});refreshConextmenu();" onclick="selectRow(this,{WFIP_ID:'${row.WFIP_ID}',WFP_ID:'${row.WFP_ID}',WFP_DETAIL_URL:'${row.WFP_DETAIL_URL}'});">
	<ec:column width="50" style="text-align:center" property="_0" title="序号" value="${GLOBALROWCOUNT}" />
	<ec:column width="140" property="WFP_NAME" title="流程名称"   />
	<ec:column width="180" property="WFIP_TITLE" title="业务标题"   />
	<ec:column width="180" property="WFIP_BUSINESS_CODE" title="业务编码"   />
	<ec:column width="100" property="WFIP_LANCHER_NAME" title="发起人"   />
	<ec:column width="140" property="WFIP_LANCH_TIME" title="发起时间"  cell="date" format="yyyy-MM-dd HH:mm" />
	<ec:column width="100" property="WFIP_OPERATER_NAME" title="最近操作人"   />
	<ec:column width="140" property="WFIP_OPERATER_TIME" title="最近操作时间"  cell="date" format="yyyy-MM-dd HH:mm" />	
</ec:row>
</ec:table>
<input type="hidden" name="WFIP_ID" id="WFIP_ID" value="" />
<input type="hidden" name="WFP_ID" id="WFP_ID" value="" />
<input type="hidden" name="WFP_DETAIL_URL" id="WFP_DETAIL_URL" value="" />
<input type="hidden" name="embed" id="embed" value="<%=pageBean.inputValue("embed")%>" />
<input type="hidden" name="actionType" id="actionType" />
<script language="JavaScript">
var ectableMenu = new EctableMenu('contextMenu','ec_table');
initCalendar('sdate','%Y-%m-%d','sdatePicker');
initCalendar('edate','%Y-%m-%d','edatePicker');
setRsIdTag('WFIP_ID');
</script>
</form>
</body>
</html>
<%@include file="/jsp/inc/scripts.inc.jsp"%>
